<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>购物车</title>
	<link rel="stylesheet" type="text/css" href="css/reset.css">
	<link rel="stylesheet" type="text/css" href="css/shop_car.css">
	<link rel="stylesheet" type="text/css" href="css/swiper.min.css">
	<script src="js/html5shiv.min.js"></script>
	<script src="js/flexible.debug.js"></script>
	<script src="js/flexible_css.debug.js"></script>
	<script src="js/jquery-1.12.4.min.js"></script>
	<script src="js/swiper.jquery.min.js"></script>
</head>
<body>
	<header class="shop_header">
		<span class="shop_back"><img src="img/fanhui@2x.png"></span>
		<span>购物车</span>
		<span class="shop_edit">编辑</span>
	</header>
	<dl class="shop_goods">
		<span class="checkOne">√</span>
		<dt><img src="img/car_goods1.png"></dt>
		<dd>
			<p>Gucci古驰专柜购入机械表，闲置九成新便...</p>
			<p>￥8000</p>
		</dd>
		<span class="deleteOne">删除</span>
	</dl>
	<dl class="shop_goods">
		<span class="checkOne">√</span>
		<dt><img src="img/car_goods2.png"></dt>
		<dd>
			<p>Dior迪奥唇膏口红烈艳蓝金唇膏3.5g系列 999#传奇红...</p>
			<p>￥320</p>
		</dd>
		<span class="deleteOne">删除</span>
	</dl>
	<dl class="shop_goods">
		<span class="checkOne">√</span>
		<dt><img src="img/car_goods3.png"></dt>
		<dd>
			<p>Chanel香奈儿邂逅柔情淡香水50ml...</p>
			<p>￥799</p>
		</dd>
		<span class="deleteOne">删除</span>
	</dl>
	<footer class="shop_footer">
		<label>
			<span class="checkAll">√</span>全选
		</label>
		<input type="button"  class="goPay" value="去结算">
	</footer>

	<script type="text/javascript">
		$(function(){
			$('.checkOne').click(function(){
				if($(this).hasClass('checkOn')){
					$(this).removeClass('checkOn');
					$(this).parent().removeClass('changeBg');
				}else{
					$(this).addClass('checkOn');
					$(this).parent().addClass('changeBg');
				}
			})
			$('.checkOne').each(function(i,v){
				console.log($(v).hasClass('checkOn'))
				/*if($(v).hasClass('checkOn')){
					$('.checkAll').addClass('checkOn');
				};*/
			})
			$('.shop_edit').click(function(){
				if($(this).html() == '编辑'){
					$('.deleteOne').show();
					$(this).html('取消');
				}else{
					$('.deleteOne').hide();
					$(this).html('编辑');
				}
			})
			$('.deleteOne').click(function(){
				$(this).parent().remove();
			})
			$('.checkAll').click(function(){
				if($(this).hasClass('checkOn')){
					$(this).removeClass('checkOn');
					$('.checkOne').removeClass('checkOn');
					$('dl').removeClass('changeBg');
				}else{
					$(this).addClass('checkOn');
					$('.checkOne').addClass('checkOn');
					$('dl').addClass('changeBg');
				}
			})
			$('.shop_back').click(function(){
				window.history.back();
			})
		})
	</script>
</body>
</html>